<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" session="false"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- 
  - Author(s): Robert
  - Date: 2018-04-09 14:08:48
  - Description:
-->
<head>
<title>任务详情</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<script src="<%=request.getContextPath()%>/common/nui/nui.js"
	type="text/javascript"></script>

</head>
<body>
	<table style="width: 100%; height: 15%; table-layout: fixed;"
		class="nui-form-table" border="1" cellspacing="0">
		<tr>
			<td class="form_label">任务标题:</td>
			<td colspan="1" id="id_task_title"></td>
			<td class="form_label">任务状态:</td>
			<td colspan="1" id="id_task_status"></td>
		</tr>
		<tr>
			<td class="form_label">任务类型:</td>
			<td colspan="1" id="id_task_type"></td>
			<td class="form_label">紧急程度:</td>
			<td colspan="1" id="id_task_urgent"></td>
		</tr>
		<tr>
			<td class="form_label">接收人:</td>
			<td colspan="1" id="id_task_receiver"></td>
			<td class="form_label">发布人:</td>
			<td colspan="1" id="id_task_sendder"></td>
		</tr>
		<tr>
			<td class="form_label">更新时间:</td>
			<td colspan="1" id="id_task_utime"></td>
			<td class="form_label">创建时间:</td>
			<td colspan="1" id="id_task_ctime"></td>
		</tr>
		<tr>
			<td class="form_label">所属项目:</td>
			<td colspan="3" id="projectName"></td>
		</tr>
		<tr>
			<td class="form_label">任务描述:</td>
			<td colspan="3" id="id_task_desc"></td>
		</tr>
	</table>
	<script type="text/javascript">
    	nui.parse();
    	//获取传递到页面的任务id号码
		var taskId = "<%=request.getParameter("taskId")%>";
		//组成json通过接口获取任务详情
		var json = "{'zhmytask':{'taskId':" + taskId + "}}";
		$.ajax({
				url : "com.zhmy.xmgl.zhmytaskbiz.getZhmyTask.biz.ext",
				type : 'POST',
				data : json,
				cache : false,
				contentType : 'text/json',
				success : function(text) {
					var returnJson = nui.decode(text);
					if (returnJson.exception == null) {
						//设置任务详情到页面上
						document.getElementById("id_task_title").innerHTML = returnJson.zhmytask.taskTitle;
						document.getElementById("id_task_sendder").innerHTML = returnJson.zhmytask.taskFounder;
						document.getElementById("id_task_receiver").innerHTML = returnJson.zhmytask.taskSendee;
						document.getElementById("id_task_ctime").innerHTML = returnJson.zhmytask.taskCtime;
						document.getElementById("id_task_utime").innerHTML = returnJson.zhmytask.taskUtime;

						//把相应的数字通过字典翻译成显示汉字
						var task_type = nui.getDictText('TASK_TYPE',returnJson.zhmytask.taskType);
						document.getElementById("id_task_type").innerHTML = task_type;
	
						var task_urgent = nui.getDictText('URGENT_DEGREE',returnJson.zhmytask.taskLevel);
						document.getElementById("id_task_urgent").innerHTML = task_urgent;

						var task_status = nui.getDictText('TASK_STATUS',returnJson.zhmytask.taskStatus);
						document.getElementById("id_task_status").innerHTML = task_status;

						document.getElementById("id_task_desc").innerHTML = returnJson.zhmytask.taskDescibe;
						document.getElementById("projectName").innerHTML = returnJson.zhmytask.zhmyProject.projectName;
						//nui.alert("新增任务成功","提示");
					} else {
						nui.alert("没有找到此任务", "系统提示", function(action) {
							if (action == "ok" || action == "close") {
								// CloseWindow("saveFailed");
							}
						});
					}
				}
			});

		//关闭窗口
		function CloseWindow() {
			if (window.CloseOwnerWindow)
				return window.CloseOwnerWindow("haha");
			else
				window.close();
		}
	</script>
</body>
</html>